import {createSlice} from '@reduxjs/toolkit'

// 使用该类型定义初始 state
const initialState = {
    datasetImageTabIndex: 0
}

const caseReducers = {
    setDatasetImageIndex: (state, action) => {
        state.datasetImageTabIndex = parseInt(action.payload)
    }
}

export const datasetSlice = createSlice({
    name: 'dataset',
    initialState,
    reducers: caseReducers
})

export const {setDatasetImageIndex} = datasetSlice.actions

export default datasetSlice.reducer
